package thread;

import javax.swing.border.MatteBorder;
import java.util.Scanner;

public class demo4 {
    public static int count = 0;
    public static void main(String[] args) {
        int x = 0 ;
        int y = 0;
        Scanner scanner = new Scanner(System.in);
        x = scanner.nextInt();
        y = scanner.nextInt();
        for (int a = 0;a<=y;a++){
            for (int b = a;b<=y;b++){
                for (int c = b;c<=y;c++){
                    if(a + b + c == y){
                        count++;
                        System.out.println(a +"+"+ b +"+"+ c);
                    }
                }
            }
        }
        //System.out.println(count);
//        int z = 0;
//        addd(x,y,z);
        System.out.println(count);
    }
//    public static int addd(int x,int y,int z){
//        if(x == 0){
//            return 0;
//        }
//        for(int a = z; a <=y;a++){
//            x--;
//            int b = addd(x,y,a);
//            if(a + b == y){
//                count++;
//            }
//        }
//        return 0;
//    }

}

